package com.sdry.product.prod.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sdry.basic.entity.Container;
import com.sdry.common.BaseController;
import com.sdry.common.BaseTypeEnum;
import com.sdry.common.ResultAppInfo;
import com.sdry.common.TableDataInfo;
import com.sdry.product.prehangingline.entity.PreHangingLine;
import com.sdry.product.prehangingline.entity.StationMateriel;
import com.sdry.product.prehangingline.service.PreHangingLineService;
import com.sdry.product.prod.entity.ProductHandleOut;
import com.sdry.product.prod.service.ProductHandleOutService;
import com.sdry.system.entity.SysUser;
import com.sdry.system.service.UserService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (前处理区)表控制层
 *
 * @author makejava
 * @since 2020-03-03 17:49:30
 */
@Controller
@RequestMapping("productHandleOut")
public class ProductHandleOutController extends BaseController {
    /**
     * 服务对象
     */
    @Resource
    private ProductHandleOutService productHandleOutService;

    @Resource
    private PreHangingLineService preHangingLineService;

    @Resource
    private UserService userService;


    /**
     * 出展示
     * @return
     */
    @RequestMapping(value = "showProductHandleOut")
    public String showProductHandleOut() {
        return "/product/prod/productHandleOut";
    }

    /**
     * 进展示
     * @return
     */
    @RequestMapping(value = "showProductHandleIn")
    public String showProductHandleIn() {
        return "/product/prod/productHandleIn";
    }
    /**
     * 库存展示
     * @return
     */
    @RequestMapping(value = "showProductHandleStock")
    public String showProductHandleStock() {
        return "/product/prod/productHandleStock";
    }



    /**
     * 分页查询前处理区
     * @param productHandleOut 前处理区
     * @return TableDataInfo
     */
    @RequestMapping(value = "queryPreHangingLinePage")
    @ResponseBody
    public TableDataInfo queryPreHangingLinePage(ProductHandleOut productHandleOut) {
        logger.info("分页查询前处理区 productHandleOut = {} " + JSONObject.fromObject(productHandleOut));
        List<ProductHandleOut> productHandleOutList = productHandleOutService.queryPreHangingLinePage(productHandleOut);
        Long total = productHandleOutService.queryPreHangingLineTotal(productHandleOut);
        return getDataTable(productHandleOutList,total);
    }




}